
/**
 * @FileName AssertUtil.java
 * @Desciption TODO
 * @author zhouchuanbo
 * @date 2019年9月24日
 */
package com.ruoyi.edit.utils;

import org.apache.commons.lang3.StringUtils;

import java.util.Collection;

/**
 * @Description 字符串空和非空判断，列表空和非空判断
 * @FileName AssertUtil.java
 * @author zhouchuanbo
 * @date 2019年9月24日
 */
public class AssertUtil {
    public static boolean isNotEmpty(Collection coll) {
        return !isEmpty(coll);
    }

    public static boolean isEmpty(Collection coll) {
        return (coll == null || coll.isEmpty());
    }

    public static boolean isEmpty(String str) {
        return str == null || str.length() == 0;
    }

    public static boolean isNotEmpty(String str) {
        return !isEmpty(str);
    }

    public static boolean isEmpty(Object obj) {
        return obj == null || (obj + "").trim().length() == 0;
    }

    public static boolean isNotEmpty(Object obj) {
        return !isEmpty(obj);
    }


    public static boolean isEquals(String coll) {
        return StringUtils.equals(coll, "null") || StringUtils.equals(coll, "0") || StringUtils.equals(coll, "undefined");
    }

    public static void main(String[] args) {
        String name = "xxw";
        String id = "xxw100321";
        String v = id.substring(id.length() -1);
        id = id.substring(0, id.length() - 1);

        id = id+ (Integer.parseInt(v)+1);
        System.out.println(id);
    }

}
